/************************************************************************
 * @file ServiceRegistry.h
 * @author Ian Chen
 * @version 1.0
 *
 * @section LICENSE
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 3 of
 * the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
 * General Public License for more details at
 * http://www.gnu.org/licenses/lgpl.html
 *
 ************************************************************************/
#ifndef SERVICEREGISTRY_H
#define SERVICEREGISTRY_H

#include <map>
#include <vector>

using namespace std;

#include <QObject>
#include <QString>

#include <plugin/plugin_global.h>

namespace antu
{
namespace plugin
{
class AbstractService;

typedef vector<AbstractService*> ServiceList;
typedef map<QString, ServiceList> ServiceMap;

class ServiceRegistry : public QObject
{
    Q_OBJECT
public:
    ServiceRegistry(QObject *parent = 0);
    ~ServiceRegistry();

    void registerService(const QString& pluginCode, AbstractService* pService);

signals:

    void serviceAvailable(const QString& pluginCode, const QString& serviceName, AbstractService* pService);

private:
    ServiceMap m_oServices;
};
}
}

#endif // SERVICEREGISTRY_H
